$OpenBSD: patch-Makefile,v 1.3 2010/07/05 10:42:48 jasper Exp $

Use INSTALL_DATA/INSTALL_PROGRAM here to make sure we end up with the correct
permissions being set (cp -p).

--- Makefile.orig	Sat Dec 26 11:00:56 2009
+++ Makefile	Mon Jul  5 10:34:21 2010
@@ -1,19 +1,19 @@
 # The directory where all the bouml files will be installed, you
 # can change it for instance because you don't have root permission
-BOUML_LIB = /usr/lib/bouml
+BOUML_LIB = ${PREFIX}/share/bouml
 
 # The directory where the bouml shell script will be installed, you
 # can change it for instance because you don't have root permission
-BOUML_DIR = /usr/bin
+BOUML_DIR = ${PREFIX}/bin
 
 # The directory containing bouml.desktop
 # The copy is not done if you comment the definition
-BOUML_DESKTOP_DIR = /usr/share/applications
+BOUML_DESKTOP_DIR = ${PREFIX}/share/applications
 
 # The directories containing the bouml icons are
 # <BOUML_ICONS_PREFIX_DIR>/<size>x<size>/apps
 # The copy is not done if you comment the definition
-BOUML_ICONS_PREFIX_DIR = /usr/share/icons/hicolor
+BOUML_ICONS_PREFIX_DIR = ${PREFIX}/share/icons/hicolor
 
 # On several Unix systems, the icons used inside the
 # menus must be stored inside the pixmaps' directory.
@@ -26,7 +26,7 @@ BOUML_ICONS_PREFIX_DIR = /usr/share/icons/hicolor
 # uncomment if needed
 # MAKE = make
 
-QMAKE=qmake
+QMAKE?=qmake
 
 SRC_DIRS = src \
 	src/CppGenerator \
@@ -111,9 +111,9 @@ install:
 	then \
 		for i in 16 32 48 64; do \
 			mkdir -p "$(DESTDIR)$(BOUML_ICONS_PREFIX_DIR)/$$i"x"$$i/apps"; \
-			cp -p bouml.$$i.png "$(DESTDIR)$(BOUML_ICONS_PREFIX_DIR)/$$i"x"$$i/apps/bouml.png"; \
-			cp -p projectControl.$$i.png "$(DESTDIR)$(BOUML_ICONS_PREFIX_DIR)/$$i"x"$$i/apps/projectControl.png"; \
-			cp -p projectSynchro.$$i.png "$(DESTDIR)$(BOUML_ICONS_PREFIX_DIR)/$$i"x"$$i/apps/projectSynchro.png"; \
+			${BSD_INSTALL_DATA} bouml.$$i.png "$(DESTDIR)$(BOUML_ICONS_PREFIX_DIR)/$$i"x"$$i/apps/bouml.png"; \
+			${BSD_INSTALL_DATA} projectControl.$$i.png "$(DESTDIR)$(BOUML_ICONS_PREFIX_DIR)/$$i"x"$$i/apps/projectControl.png"; \
+			${BSD_INSTALL_DATA} projectSynchro.$$i.png "$(DESTDIR)$(BOUML_ICONS_PREFIX_DIR)/$$i"x"$$i/apps/projectSynchro.png"; \
 		done; \
 	fi
 	if test -n "$(BOUML_UNIX_PIXMAPS_DIR)"; then \
@@ -122,16 +122,9 @@ install:
 		cp -f projectControl.48.png "$(DESTDIR)$(BOUML_UNIX_PIXMAPS_DIR)/projectControl.png"; \
 		cp -f projectSynchro.48.png "$(DESTDIR)$(BOUML_UNIX_PIXMAPS_DIR)/projectSynchro.png"; \
 	fi
-	cp -p *.lang "$(DESTDIR)$(BOUML_LIB)"
-	for i in $(PROGS); do cp -p $$i "$(DESTDIR)$(BOUML_LIB)" ; done
+	${BSD_INSTALL_PROGRAM} *.lang "$(DESTDIR)$(BOUML_LIB)"
+	for i in $(PROGS); do ${BSD_INSTALL_PROGRAM} $$i "$(DESTDIR)$(BOUML_DIR)" ; done
 	cd plugouts ; tar cf - empty genpro html rose singleton cpp_utilities xmi xmi2 xmi2import sm_generator usecase_wizard sort uml_projection FileControl deploy GlobalChange | (cd $(DESTDIR)$(BOUML_LIB); tar xf -)
-	echo "#!/bin/sh" >$(DESTDIR)$(BOUML_DIR)/bouml
-	echo "PATH=$(BOUML_LIB):$$"PATH >>$(DESTDIR)$(BOUML_DIR)/bouml
-	echo "BOUML_LIB_DIR=$(BOUML_LIB)" >>$(DESTDIR)$(BOUML_DIR)/bouml
-	echo "export PATH" >>$(DESTDIR)$(BOUML_DIR)/bouml
-	echo "export BOUML_LIB_DIR" >>$(DESTDIR)$(BOUML_DIR)/bouml
-	echo "exec $(BOUML_LIB)/bouml \"$$"@"\"" >>$(DESTDIR)$(BOUML_DIR)/bouml
-	chmod +x "$(DESTDIR)$(BOUML_DIR)/bouml"
 	cd $(DESTDIR)$(BOUML_DIR) ; rm -f projectControl ; ln -s $(BOUML_LIB)/projectControl
 	cd $(DESTDIR)$(BOUML_DIR) ; rm -f projectSynchro ; ln -s $(BOUML_LIB)/projectSynchro
 	if test -n "$(BOUML_DESKTOP_DIR)" ; \
@@ -151,7 +144,7 @@ install:
 		echo "Name=Project Control" >> "$(DESTDIR)$(BOUML_DESKTOP_DIR)/projectControl.desktop" ; \
 		echo "Type=Application" >> "$(DESTDIR)$(BOUML_DESKTOP_DIR)/projectControl.desktop" ; \
 		echo "Comment=Bouml project's files control" >> "$(DESTDIR)$(BOUML_DESKTOP_DIR)/projectControl.desktop" ; \
-		echo "Exec=$(BOUML_LIB)/projectControl" >> "$(DESTDIR)$(BOUML_DESKTOP_DIR)/projectControl.desktop" ; \
+		echo "Exec=$(BOUML_DIR)/projectControl" >> "$(DESTDIR)$(BOUML_DESKTOP_DIR)/projectControl.desktop" ; \
 		echo "TryExec=projectControl" >> "$(DESTDIR)$(BOUML_DESKTOP_DIR)/projectControl.desktop" ; \
 		echo "Icon=projectControl" >> "$(DESTDIR)$(BOUML_DESKTOP_DIR)/projectControl.desktop" ; \
 		echo "Categories=Development;" >> "$(DESTDIR)$(BOUML_DESKTOP_DIR)/projectControl.desktop" ; \
@@ -160,7 +153,7 @@ install:
 		echo "Name=Project Synchro" >> "$(DESTDIR)$(BOUML_DESKTOP_DIR)/projectSynchro.desktop" ; \
 		echo "Type=Application" >> "$(DESTDIR)$(BOUML_DESKTOP_DIR)/projectSynchro.desktop" ; \
 		echo "Comment=Bouml project's files synchronization" >> "$(DESTDIR)$(BOUML_DESKTOP_DIR)/projectSynchro.desktop" ; \
-		echo "Exec=$(BOUML_LIB)/projectSynchro" >> "$(DESTDIR)$(BOUML_DESKTOP_DIR)/projectSynchro.desktop" ; \
+		echo "Exec=$(BOUML_DIR)/projectSynchro" >> "$(DESTDIR)$(BOUML_DESKTOP_DIR)/projectSynchro.desktop" ; \
 		echo "TryExec=projectSynchro" >> "$(DESTDIR)$(BOUML_DESKTOP_DIR)/projectSynchro.desktop" ; \
 		echo "Icon=projectSynchro" >> "$(DESTDIR)$(BOUML_DESKTOP_DIR)/projectSynchro.desktop" ; \
 		echo "Categories=Development;" >> "$(DESTDIR)$(BOUML_DESKTOP_DIR)/projectSynchro.desktop" ; \
